]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Select next window from the current app on alt+tab
authorSteve Frécinaux <code@istique.net>
Thu, 1 Oct 2009 09:23:00 +0000 (11:23 +0200)
committerDan Winship <danw@gnome.org>
Sun, 4 Oct 2009 16:45:23 +0000 (12:45 -0400)
This slightly changes the behaviour of the alt+tab window, this way:
when using alt-tab on a workspace that contains two or more windows from
the same window, the application selected when hitting alt+tab is the
currently selected application, but the highlighted window is the next
one.

Intended goal is to make it easier to cycle around windows of the same
application while not having to cycle through all the applications first.

https://bugzilla.gnome.org/show_bug.cgi?id=590563

js/ui/altTab.js
js/ui/windowManager.js

index 74cb69fa4bab8eb0c9a1869e8bb30b35deff2131..6ff06aae6360df235e43f9f98e633612b52acefe 100644 (file)
@@ -86,7 +86,7 @@ AltTabPopup.prototype = {
         this._appsBox.add_actor(box);
     },
 
-    show : function(initialSelection) {
+    show : function(backward) {
         let appMonitor = Shell.AppMonitor.get_default();
         let apps = appMonitor.get_running_apps ("");
 
@@ -138,7 +138,19 @@ AltTabPopup.prototype = {
         this.actor.x = primary.x + Math.floor((primary.width - this.actor.width) / 2);
         this.actor.y = primary.y + Math.floor((primary.height - this.actor.height) / 2);
 
-        this._updateSelection(initialSelection);
+        if (!backward && this._icons[this._selected].windows.length > 1) {
+            let candidateWindow = this._icons[this._selected].windows[1];
+            if (candidateWindow.get_workspace() == activeWorkspace) {
+                this._currentWindows[this._selected] = candidateWindow;
+                this._updateSelection(0);
+            }
+            else {
+                this._updateSelection(1);
+            }
+        }
+        else {
+            this._updateSelection(backward ? -1 : 1);
+        }
 
         // There's a race condition; if the user released Alt before
         // we got the grab, then we won't be notified. (See
index c01a510eefa480f91d12bffd4a83434d5077465a..46e5964ef7685a111ba9a10a9bb655e59192325c 100644 (file)
@@ -274,7 +274,7 @@ WindowManager.prototype = {
     _startAppSwitcher : function(shellwm, binding, window, backwards) {
         let tabPopup = new AltTab.AltTabPopup();
 
-        if (!tabPopup.show(backwards ? -1 : 1))
+        if (!tabPopup.show(backwards))
             tabPopup.destroy();
     }
 };